package com.usian.admin.job;

import com.usian.admin.feign.WmNewFeign;
import com.usian.admin.service.WemediaNewsAutoScanService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class WeMediaNewsAutoScanJob {

    @Autowired
    WmNewFeign wmNewFeign;
    @Autowired
    WemediaNewsAutoScanService wemediaNewsAutoScanService;


    @XxlJob("shengheJob")
    public ReturnT<String> scanJob(String param){
        System.out.println("========="+param);
        //1:查要发布的文章id List
        List<Integer> list = wmNewFeign.findRelease();

        //2: 循环调用审核接口
        if(list.size()>0){
            for(Integer wmnewId :list){
                boolean result = wemediaNewsAutoScanService.autoScanByMediaNewsId(wmnewId);
            }
        }
       return ReturnT.SUCCESS;
    }
}
